package com.king.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by king on 2018/03/07.
 */
@RestController
public class FeignController {

    final
    FeignService feignService;

    @Autowired
    public FeignController(FeignService feignService) {
        this.feignService = feignService;
    }

    @RequestMapping(value = "/info",method = RequestMethod.GET)
    public String feignHi(String name){

        if(name == null)
            name = "king";

        return feignService.feignHi(name);
    }

}
